<!DOCTYPE html>
<html>
<head>
	<title>{blogName}-{blogMemo}</title>
	<script src="template/css/jquery.min.js"></script>
	<script src="template/layui/layui.js" charset="utf-8"></script>
	<link rel="stylesheet" href="template/layui/css/layui.css" />
	<link rel="stylesheet" href="template/css/global.css" />
	<link rel="stylesheet" href="template/css/style.css" />	
</head>
<script type="text/javascript">
	layui.use('element', function(){
  var element = layui.element;
});
	function jsonSort(array,field,reverse){if(array.length<2||!field||typeof array[0]!=="object"){return array}if(typeof array[0][field]==="number"){array.sort(function(x,y){return x[field]-y[field]})}if(typeof array[0][field]==="string"){array.sort(function(x,y){return x[field].localeCompare(y[field])})}if(reverse){array.reverse()}return array}
</script>
<body>
	<div style="max-width:980px" class="p20">
		<div class="logo tc p20"><img src="{avatar}" width="150" class="blo">
			<h1>{blogName}</h1>
			<em>{blogMemo}</em>
		</div>
		<a href="?{current}" class="layui-bg-red searchKey">关于"{searchKey}"的搜索结果 <i class="layui-icon">&#x1006;</i></a>
		<div id="this_top_1"></div><div id="this_page_list"></div><div class="clear"></div><div id="this_page_page"></div>
		<script>
			var dir='{dir}';var isLogin={isLogin};var flist = {flist};var flist2 = jsonSort(flist, 'lastdate', true);layui.use(["laypage","layer"],function(){var laypage=layui.laypage,layer=layui.layer;var data=flist2;laypage.render({elem:"this_page_page",count:data.length,limit:20,curr:location.hash.replace("#!p=",""),hash:"p",jump:function(obj){$("html, body").animate({scrollTop:$("#this_top_1").offset().top-100},200);document.getElementById("this_page_list").innerHTML=function(){var arr=[],thisData=data.concat().splice(obj.curr*obj.limit-obj.limit,obj.limit);layui.each(thisData,function(index,item){var bianhao=(obj.curr-1)*obj.limit+index+1;arr.push('<li class="list" fname="'+item.title+'"><h2>'+item.title.replace("."+item.title.split(".")[item.title.split(".").length-1],"")+"</h2><span>"+item.lastdate+'</span><em class="thumb"></em></li>')});return arr.join("")}();thumb();$(".list").on("click",function(){fname=$(this).attr("fname");fname2=$(this).find("h2").text();$.ajax({type:"POST",cache:false,data:{fnames:fname},datatype:"text",success:function(Msg){layer.open({type:1,title:fname2,skin:"layui-layer-rim",area:["980px","800px"],content:'<a class="layui-btn layui-btn-danger abs editBtn layui-btn-xs show_'+isLogin.toString()+'" onclick="admin(2)"><i class="layui-icon">&#xe642;</i> 编辑</a><div class="p20 f16 contents">'+Msg.replace(/[\r\n]/g,"<br>")+"</div>"})}})})}})});</script>
			<div class="tc p5 gray">ASP单文件轻博客 &copy; www.jswwl.com</div>	
	</div>	
	<div class="fix menuBox">
	<div class="tc layui-bg-cyan p10" style="border-radius:8px 8px 0 0">似水流年</div>
	<ul class="layui-timeline p20" style="padding-bottom: 0">		
		{#:loop}
  <li class="layui-timeline-item">
    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
    <div class="layui-timeline-content layui-text">
      <h3 class="layui-timeline-title"><a href="?{loop.year}">{loop.year}年</a></h3>
    </div>
  </li>  {/#:loop}
</ul>
<div class="tc p5 search"><i class="layui-icon f20">&#xe615;</i></div>
</div>
</body>
</html>
<script type="text/javascript">
function thumb(){var fnames="";$(".thumb").each(function(){fnames=fnames+$(this).parent("li").attr("fname")+"|||";$(this).html("加载中...")});$.ajax({type:"POST",cache:false,data:{fnames:fnames},datatype:"text",success:function(Msg){eval(Msg)}})}function admin(nums){if(isLogin!=1){layer.alert("您无权限操作！");return false}else{if(nums==2){type="编辑文档";title=$(".layui-layer-title").text();contents=$(".contents").html()}else{if(nums==1){type="新增文档";title="";contents=""}}layer.closeAll();layer.open({type:1,title:type,skin:"layui-layer-rim",area:["800px","600px"],content:'<div class="p20 f16 contents"><form class="layui-form layui-form-pane"><input name="oldTitle" hidden value="'+title+'"><div class="layui-form-item"><label class="layui-form-label">标题 <font color="red">*</font></label><div class="layui-input-block"><input type="text" name="title" required value="'+title+'"  lay-verify="required" placeholder="请填写标题" autocomplete="off" class="layui-input"></div></div><textarea id="demo" style="display: none;">'+contents+'</textarea><div style="padding: 20px 0" class="clear"><button class="layui-btn fr" lay-submit lay-filter="formDemo">立即提交</button></div></form></div>'});layui.use(["form","layedit"],function(){var form=layui.form;var layedit=layui.layedit;layedit.set({uploadImage:{multiple:true,number:10,size:500,before:function(res){layer.load()},allDone:function(obj){layer.closeAll("loading")}}});var editIndex=layedit.build("demo",{height:350});form.on("submit(formDemo)",function(data){layer.alert("确定要保存吗?",{icon:3},function(index){layedit.sync(editIndex);var memo=layedit.getContent(editIndex);$.ajax({type:"POST",cache:false,data:{data:JSON.stringify(data.field),memo:memo},datatype:"text",success:function(Msg){eval(Msg)}});layer.close(index)});return false})})}}layui.use("util",function(){var util=layui.util;util.fixbar({bar1:"&#xe642;",bar2:"&#xe770;",click:function(type){if(type==="bar1"){admin(1)}else{if(type==="bar2"){if(isLogin==1){layer.confirm("确定要注销吗?",{icon:3,title:"提示"},function(index){$.ajax({type:"POST",cache:false,data:{logout:1},datatype:"text",success:function(Msg){isLogin=0}});layer.close(index)})}else{layer.open({type:1,title:"登录",skin:"layui-layer-rim",area:["300px","150px"],content:'<div class="p20 f16 contents"><form class="layui-form layui-form-pane" action=""><input type="password" name="password" required value=""  lay-verify="required" autocomplete="off" class="layui-input fl" style="display:inline;width:160px"><button class="layui-btn fr" lay-submit lay-filter="formDemo2">登录</button></form></div>'});layui.use("form",function(){var form=layui.form;form.on("submit(formDemo2)",function(data){$.ajax({type:"POST",cache:false,data:{password:data.field.password},datatype:"text",success:function(Msg){eval(Msg)}});return false})})}}}}})});var current = {current};var searchKey='{searchKey}';if(!searchKey){$(".searchKey").hide()}$(".search").click(function(){layer.open({type:1,title:"搜索",skin:"layui-layer-rim",area:["300px","150px"],content:'<div class="p20 f16 contents"><form class="layui-form layui-form-pane" method="post" action="?'+current+'"><input type="text" name="searchKey" required value=""  lay-verify="required" autocomplete="off" class="layui-input fl" style="display:inline;width:160px"><button class="layui-btn fr" type="submit">搜索</button></form></div>'})});
</script>